<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: /data/users/hoss/faiss/IVFlib.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">/data/users/hoss/faiss/IVFlib.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) Facebook, Inc. and its affiliates.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * This source code is licensed under the MIT license found in the</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// -*- c++ -*-</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef FAISS_IVFLIB_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FAISS_IVFLIB_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span><span class="comment"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">/** Since IVF (inverted file) indexes are of so much use for</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * large-scale use cases, we group a few functions related to them in</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * this small library. Most functions work both on IndexIVFs and</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * IndexIVFs embedded within an IndexPreTransform.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;IndexIVF.h&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">namespace </span>faiss { <span class="keyword">namespace </span>ivflib {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">/** check if two indexes have the same parameters and are trained in</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> * the same way, otherwise throw. */</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keywordtype">void</span> check_compatible_for_merge (<span class="keyword">const</span> Index * index1,</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;                                 <span class="keyword">const</span> Index * index2);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">/** get an IndexIVF from an index. The index may be an IndexIVF or</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> * some wrapper class that encloses an IndexIVF</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> * throws an exception if this is not the case.</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">const</span> IndexIVF * extract_index_ivf (<span class="keyword">const</span> Index * index);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;IndexIVF * extract_index_ivf (Index * index);</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/** Merge index1 into index0. Works on IndexIVF&#39;s and IndexIVF&#39;s</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment"> *  embedded in a IndexPreTransform. On output, the index1 is empty.</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment"> * @param shift_ids: translate the ids from index1 to index0-&gt;prev_ntotal</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keywordtype">void</span> merge_into(Index *index0, Index *index1, <span class="keywordtype">bool</span> shift_ids);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">typedef</span> <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> idx_t;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">/* Returns the cluster the embeddings belong to.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment"> * @param index      Index, which should be an IVF index</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment"> *                   (otherwise there are no clusters)</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment"> * @param embeddings object descriptors for which the centroids should be found,</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment"> *                   size num_objects * d</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment"> * @param centroid_ids</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment"> *                   cluster id each object belongs to, size num_objects</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keywordtype">void</span> search_centroid(Index *index,</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                     <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">int</span> n,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                     idx_t* centroid_ids);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">/* Returns the cluster the embeddings belong to.</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment"> * @param index      Index, which should be an IVF index</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment"> *                   (otherwise there are no clusters)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment"> * @param query_centroid_ids</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment"> *                   centroid ids corresponding to the query vectors (size n)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment"> * @param result_centroid_ids</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment"> *                   centroid ids corresponding to the results (size n * k)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment"> * other arguments are the same as the standard search function</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keywordtype">void</span> search_and_return_centroids(Index *index,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                                 <span class="keywordtype">size_t</span> n,</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                                 <span class="keyword">const</span> <span class="keywordtype">float</span>* xin,</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                                 <span class="keywordtype">long</span> k,</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                                 <span class="keywordtype">float</span> *distances,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                                 idx_t* labels,</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                                 idx_t* query_centroid_ids,</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                                 idx_t* result_centroid_ids);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="comment">/** A set of IndexIVFs concatenated together in a FIFO fashion.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment"> * at each &quot;step&quot;, the oldest index slice is removed and a new index is added.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html">   83</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html">SlidingIndexWindow</a> {<span class="comment"></span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">    /// common index that contains the sliding window</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a2aae96a9373173e22686951e85b31aa1">   85</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1Index.html">Index</a> * <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a2aae96a9373173e22686951e85b31aa1">index</a>;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment">    /// InvertedLists of index</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a10d876a9c750bc95986a22a57cf4fdc7">   88</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1ArrayInvertedLists.html">ArrayInvertedLists</a> *<a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a10d876a9c750bc95986a22a57cf4fdc7">ils</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">    /// number of slices currently in index</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a8defa5121e371e64071c0eb956ad20d1">   91</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a8defa5121e371e64071c0eb956ad20d1">n_slice</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment">    /// same as index-&gt;nlist</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#ac124372fd2b67bb901f0c71235165216">   94</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">size_t</span> <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#ac124372fd2b67bb901f0c71235165216">nlist</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">    /// cumulative list sizes at each slice</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a6dfc430601d194c428c2a25e3afa4492">   97</a></span>&#160;<span class="comment"></span>    std::vector&lt;std::vector&lt;size_t&gt; &gt; <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a6dfc430601d194c428c2a25e3afa4492">sizes</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">    /// index should be initially empty and trained</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a6347809123313ca945defdc7ddcd1465">SlidingIndexWindow</a> (<a class="code" href="structfaiss_1_1Index.html">Index</a> *<a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a2aae96a9373173e22686951e85b31aa1">index</a>);</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">    /** Add one index to the current index and remove the oldest one.</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">     * @param sub_index        slice to swap in (can be NULL)</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">     * @param remove_oldest    if true, remove the oldest slices */</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#accf1c7b8de188b74de0d6827beceac7c">step</a>(<span class="keyword">const</span> <a class="code" href="structfaiss_1_1Index.html">Index</a> *sub_index, <span class="keywordtype">bool</span> remove_oldest);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;};</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">/// Get a subset of inverted lists [i0, i1)</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment"></span><a class="code" href="structfaiss_1_1ArrayInvertedLists.html">ArrayInvertedLists</a> * get_invlist_range (<span class="keyword">const</span> <a class="code" href="structfaiss_1_1Index.html">Index</a> *index,</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                                        <span class="keywordtype">long</span> i0, <span class="keywordtype">long</span> i1);</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment">/// Set a subset of inverted lists</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment"></span><span class="keywordtype">void</span> set_invlist_range (<a class="code" href="structfaiss_1_1Index.html">Index</a> *index, <span class="keywordtype">long</span> i0, <span class="keywordtype">long</span> i1,</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                        <a class="code" href="structfaiss_1_1ArrayInvertedLists.html">ArrayInvertedLists</a> * src);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">// search an IndexIVF, possibly  embedded in an IndexPreTransform</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">// with given parameters</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="keywordtype">void</span> search_with_parameters (<span class="keyword">const</span> <a class="code" href="structfaiss_1_1Index.html">Index</a> *index,</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                             idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x, idx_t k,</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                             <span class="keywordtype">float</span> *distances, idx_t *labels,</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                             <a class="code" href="structfaiss_1_1IVFSearchParameters.html">IVFSearchParameters</a> *params);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;} } <span class="comment">// namespace faiss::ivflib</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="structfaiss_1_1ArrayInvertedLists_html"><div class="ttname"><a href="structfaiss_1_1ArrayInvertedLists.html">faiss::ArrayInvertedLists</a></div><div class="ttdoc">simple (default) implementation as an array of inverted lists </div><div class="ttdef"><b>Definition:</b> <a href="InvertedLists_8h_source.html#l00182">InvertedLists.h:182</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_ac124372fd2b67bb901f0c71235165216"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#ac124372fd2b67bb901f0c71235165216">faiss::ivflib::SlidingIndexWindow::nlist</a></div><div class="ttdeci">size_t nlist</div><div class="ttdoc">same as index-&amp;gt;nlist </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00094">IVFlib.h:94</a></div></div>
<div class="ttc" id="structfaiss_1_1IVFSearchParameters_html"><div class="ttname"><a href="structfaiss_1_1IVFSearchParameters.html">faiss::IVFSearchParameters</a></div><div class="ttdef"><b>Definition:</b> <a href="IndexIVF_8h_source.html#l00060">IndexIVF.h:60</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html_ad3f0d3071f987baabbdd3da4500c87ea"><div class="ttname"><a href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">faiss::Index::idx_t</a></div><div class="ttdeci">long idx_t</div><div class="ttdoc">all indices are this type </div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00062">Index.h:62</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_a10d876a9c750bc95986a22a57cf4fdc7"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a10d876a9c750bc95986a22a57cf4fdc7">faiss::ivflib::SlidingIndexWindow::ils</a></div><div class="ttdeci">ArrayInvertedLists * ils</div><div class="ttdoc">InvertedLists of index. </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00088">IVFlib.h:88</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_a8defa5121e371e64071c0eb956ad20d1"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a8defa5121e371e64071c0eb956ad20d1">faiss::ivflib::SlidingIndexWindow::n_slice</a></div><div class="ttdeci">int n_slice</div><div class="ttdoc">number of slices currently in index </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00091">IVFlib.h:91</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html">faiss::ivflib::SlidingIndexWindow</a></div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00083">IVFlib.h:83</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_a6dfc430601d194c428c2a25e3afa4492"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a6dfc430601d194c428c2a25e3afa4492">faiss::ivflib::SlidingIndexWindow::sizes</a></div><div class="ttdeci">std::vector&lt; std::vector&lt; size_t &gt; &gt; sizes</div><div class="ttdoc">cumulative list sizes at each slice </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00097">IVFlib.h:97</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_a6347809123313ca945defdc7ddcd1465"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a6347809123313ca945defdc7ddcd1465">faiss::ivflib::SlidingIndexWindow::SlidingIndexWindow</a></div><div class="ttdeci">SlidingIndexWindow(Index *index)</div><div class="ttdoc">index should be initially empty and trained </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8cpp_source.html#l00159">IVFlib.cpp:159</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_accf1c7b8de188b74de0d6827beceac7c"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#accf1c7b8de188b74de0d6827beceac7c">faiss::ivflib::SlidingIndexWindow::step</a></div><div class="ttdeci">void step(const Index *sub_index, bool remove_oldest)</div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8cpp_source.html#l00190">IVFlib.cpp:190</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html"><div class="ttname"><a href="structfaiss_1_1Index.html">faiss::Index</a></div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00061">Index.h:61</a></div></div>
<div class="ttc" id="structfaiss_1_1ivflib_1_1SlidingIndexWindow_html_a2aae96a9373173e22686951e85b31aa1"><div class="ttname"><a href="structfaiss_1_1ivflib_1_1SlidingIndexWindow.html#a2aae96a9373173e22686951e85b31aa1">faiss::ivflib::SlidingIndexWindow::index</a></div><div class="ttdeci">Index * index</div><div class="ttdoc">common index that contains the sliding window </div><div class="ttdef"><b>Definition:</b> <a href="IVFlib_8h_source.html#l00085">IVFlib.h:85</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
